//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package cn.le.entty;

import java.io.Serializable;

public class IOTMessage<T> implements Serializable {
    private static final long serialVersionUID = 7164191834908458391L;
    private String sn;
    private String key;
    private String tag;
    private IOTMessage.Type type;
    private T payload;

    public IOTMessage() {
    }

    public IOTMessage(IOTMessage.Type type) {
        this.type = type;
    }

    public IOTMessage(String sn, IOTMessage.Type type, T payload) {
        this.sn = sn;
        this.type = type;
        this.payload = payload;
    }

    public String getSn() {
        return this.sn;
    }

    public void setSn(String sn) {
        this.sn = sn;
    }

    public String getTag() {
        return this.tag;
    }

    public void setTag(String tag) {
        this.tag = tag;
    }

    public IOTMessage.Type getType() {
        return this.type;
    }

    public void setType(IOTMessage.Type type) {
        this.type = type;
    }

    public T getPayload() {
        return this.payload;
    }

    public void setPayload(T payload) {
        this.payload = payload;
    }

    public String getKey() {
        return this.key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public static enum Type {
        JSON("json"),
        BYTE("byte"),
        HEX("hex"),
        STRING("string");

        private String name;

        private Type(String name) {
            this.name = name;
        }
    }
}
